package com.yueguang.springai.component;

import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeSwitchComponent;
import com.yueguang.springai.model.vo.OrderCreateRequestVO;

import java.util.Objects;

@LiteflowComponent("s")
public class SwitchComponent extends NodeSwitchComponent {
    @Override
    public String processSwitch() throws Exception {
        System.out.println("执行switch规则");
        Object requestData = this.getRequestData();
        final OrderCreateRequestVO requestVO = (OrderCreateRequestVO) requestData;
        if (Objects.equals(requestVO.getOrderNo(), "11111")){
            return "b";
        }
        return "a";
    }
}
